#include "Boolean.h"

Boolean::Boolean(bool b)
{
	m_bool = b;
}

const char* Boolean::toString()
{
	if (m_bool)
		return "true";
	else
		return "false";
}

bool Boolean::operator !()
{
	return !m_bool;
}

bool Boolean::operator !=(var& o)
{
	Boolean& b = static_cast<Boolean&>(*o);
	return m_bool != b.m_bool;
}

bool Boolean::operator ==(var &o)
{
	Boolean& b = static_cast<Boolean&>(*o);
	return m_bool == b.m_bool;
}

bool Boolean::operator &&(var &o)
{
	Boolean& b = static_cast<Boolean&>(*o);
	return m_bool && b.m_bool;
}

bool Boolean::operator ||(var &o)
{
	Boolean& b = static_cast<Boolean&>(*o);
	return m_bool || b.m_bool;
}

bool Boolean::operator !=(bool o)
{
	return m_bool != o;
}

bool Boolean::operator ==(bool o)
{
	return m_bool == o;
}

bool Boolean::operator &&(bool o)
{
	return m_bool && o;
}

bool Boolean::operator ||(bool o)
{
	return m_bool || o;
}

bool operator&&(bool number, var& o)
{
	return *o && number;
}

bool operator||(bool number, var& o)
{
	return *o || number;
}

bool operator!=(bool number, var& o)
{
	return *o != number;
}

bool operator==(bool number, var& o)
{
	return *o == number;
}

bool Boolean::toBool()
{
	return m_bool;
}